package com.ecoolex.ying.space.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.util.ArrayList;
import java.util.Arrays;
import org.springframework.lang.NonNull;

/**
 *
 *   优选商品<br>
 *<br>
 * 数据表： pick_goods
 *
 */
@Description({"优选商品"})
public class PickGoodsWithBLOBs extends PickGoods {
    /**
     *
     *   商品详情    <br>
     *<br>
     * 字段名： pick_goods.Detail
     */
    @Description({"商品详情", "数据长度: 65535"})
    private String detail;

    /**
     *
     *   商品参数    <br>
     *<br>
     * 字段名： pick_goods.Parameters
     */
    @Description({"商品参数", "数据长度: 65535"})
    private String parameters;

    /**
     * 获取参数<br><br>
     *
     *   商品详情    <br>
     *<br>
     * 字段名： pick_goods.Detail
     */
    public String getDetail() {
        return detail;
    }

    /**
     * 设置参数<br><br>
     *
     *   商品详情<br>
     *<br>
     * 字段名： pick_goods.Detail
     */
    public void setDetail(String detail) {
        this.detail = detail == null ? null : detail.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   商品参数    <br>
     *<br>
     * 字段名： pick_goods.Parameters
     */
    public String getParameters() {
        return parameters;
    }

    /**
     * 设置参数<br><br>
     *
     *   商品参数<br>
     *<br>
     * 字段名： pick_goods.Parameters
     */
    public void setParameters(String parameters) {
        this.parameters = parameters == null ? null : parameters.trim();
    }

    public enum Column {
        pickGoodsId("PickGoodsId", "pickGoodsId", "INTEGER", false),
        goodsId("GoodsId", "goodsId", "INTEGER", false),
        name("Name", "name", "VARCHAR", true),
        classifyId("ClassifyId", "classifyId", "INTEGER", false),
        labelIds("LabelIds", "labelIds", "VARCHAR", false),
        coded("Coded", "coded", "VARCHAR", false),
        counterPrice("CounterPrice", "counterPrice", "DECIMAL", false),
        retailPrice("RetailPrice", "retailPrice", "DECIMAL", false),
        minProductCounterPrice("MinProductCounterPrice", "minProductCounterPrice", "DECIMAL", false),
        maxProductCounterPrice("MaxProductCounterPrice", "maxProductCounterPrice", "DECIMAL", false),
        minProductRetailPrice("MinProductRetailPrice", "minProductRetailPrice", "DECIMAL", false),
        maxProductRetailPrice("MaxProductRetailPrice", "maxProductRetailPrice", "DECIMAL", false),
        currencyType("CurrencyType", "currencyType", "VARCHAR", false),
        image("Image", "image", "VARCHAR", false),
        shopwindowImages("ShopwindowImages", "shopwindowImages", "VARCHAR", false),
        source("Source", "source", "INTEGER", true),
        status("Status", "status", "INTEGER", true),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false),
        detail("Detail", "detail", "LONGVARCHAR", false),
        parameters("Parameters", "parameters", "LONGVARCHAR", true);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}